home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesU-Z.lzh / WorldChampBoxingManager.lha / WorldChampBoxingManagerHD / Install next >
Text File  |  2001-10-30  |  5KB  |  243 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")                ;name of readme file
  4. (set #save-file "WorldChampBoxingManager.save")    ;name of save game
  5.  
  6. (procedure P_MakeImages
  7.  
  8.   ;the following lines must be copied and adjusted for multiple disk images
  9.  
  10.   (set #CI_disknum 1)
  11.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  12.   (set #CI_disklen 901120)
  13.   (set #CI_skiptrk -1)
  14.   (P_CreateImage)
  15. )
  16.  
  17. ;****************************
  18. ;----------------------------
  19. ; checks if given program is installed, if not abort install
  20. ; #program - to check
  21.  
  22. (procedure P_ChkRun
  23.   (if
  24.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  25.     ("")
  26.     (abort 
  27.       (cat
  28.     "You must install \"" #program "\" first!\n"
  29.     "It must be accessible via the path.\n"
  30.     "You can find it in the WHDLoad package."
  31.       )
  32.     )
  33.   )
  34. )
  35.  
  36. ;----------------------------
  37. ; Create Image using DIC
  38. ; #dest        - path to save image in
  39. ; #CI_disknum  - number of the disk image to create
  40. ; #CI_diskname - label of the disk
  41. ; #CI_disklen  - length of disk image to create
  42. ; #CI_skiptrk  - track to skip, -1 means no skip
  43. ; #CI_drive    - drive to create image from
  44.  
  45. (procedure P_CreateImage
  46.   (message
  47.     (cat
  48.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  49.     "(make sure it's the right disk because it will not be checked)"
  50.     )
  51.   )
  52.   (if
  53.     (>= #CI_skiptrk 0)
  54.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  55.     (set #option "")
  56.   )
  57.   (if
  58.     (= 0
  59.       (run 
  60.         (cat
  61.           "cd \"" #dest "\"\n"
  62.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  63.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  64.         )
  65.       )
  66.     )
  67.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  68.     (abort "\"DIC\" has failed to create a diskimage")
  69.   )
  70. )
  71.  
  72. ;****************************
  73.  
  74. (if
  75.   (exists #readme-file)
  76.   (if
  77.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  78.     ("")
  79.     (run ("SYS:Utilities/More %s" #readme-file))
  80.   )
  81. )
  82.  
  83. (set #program "WHDLoad")
  84. (P_ChkRun)
  85.  
  86. (set #program "DIC")
  87. (P_ChkRun)
  88.  
  89. ; in expert mode ask for source drive
  90. (if
  91.   (= @user-level 2)
  92.   (
  93.     (set #CI_drive
  94.       (askchoice
  95.     (prompt "Select source drive for diskimages")
  96.     (default 0)
  97.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  98.     (help @askchoice-help)
  99.       )
  100.     )
  101.     (select #CI_drive
  102.       (set #CI_drive "DF0:")
  103.       (set #CI_drive "DF1:")
  104.       (set #CI_drive "RAD:")
  105.       (set #CI_drive
  106.         (askstring
  107.           (prompt "Select source drive for diskimages")
  108.           (default "DF0:")
  109.           (help @askstring-help)
  110.         )
  111.       )
  112.     )
  113.   )
  114.   (set #CI_drive "DF0:")
  115. )
  116.  
  117. (if
  118.   (getenv "WHDLInstPath")
  119.   (set @default-dest (getenv "WHDLInstPath"))
  120. )
  121. (set #dest
  122.   (askdir
  123.     (prompt 
  124.       (cat
  125.     "Where should \"" @app-name "\" be installed?\n"
  126.     "A drawer \"" @app-name "\" will be automatically created."
  127.       )
  128.     )
  129.     (help @askdir-help)
  130.     (default @default-dest)
  131.     (disk)
  132.   )
  133. )
  134. (run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" @default-dest))
  135. (set #dest (tackon #dest @app-name))
  136. (if
  137.   (exists #dest)
  138.   (
  139.     (set #choice
  140.       (askbool
  141.         (prompt
  142.           (cat
  143.             "\nDirectory \"" #dest "\" already exists.\n"
  144.             "Should it be deleted?"
  145.           )
  146.         )
  147.         (default 1)
  148.         (choices "Delete" "Skip")
  149.         (help @askbool-help)
  150.       )
  151.     )
  152.     (if
  153.       (= #choice 1)
  154.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  155.     )
  156.   )
  157. )
  158. (makedir #dest
  159.   (help @makedir-help)
  160.   (infos)
  161. )
  162.  
  163. ;----------------------------
  164.  
  165. (copyfiles
  166.   (help @copyfiles-help)
  167.   (source ("%s.Slave" @app-name))
  168.   (dest #dest)
  169. )
  170. (if
  171.   (exists ("%s.newicon" @app-name))
  172.   (set #icon
  173.     (askchoice
  174.       (prompt "\nWhich icon would you like to install?\n")
  175.       (default 0)
  176.       (choices "Normal" "NewIcon" "GlowIcon")
  177.       (help @askchoice-help)
  178.     )
  179.   )
  180.   (set #icon 0)
  181. )
  182. (select #icon
  183.   (set #icon ("%s.inf" @app-name))
  184.   (set #icon ("%s.new" @app-name))
  185.   (set #icon ("%s.glow" @app-name))
  186. )
  187. (copyfiles
  188.   (help @copyfiles-help)
  189.   (source #icon)
  190.   (newname ("%s.info" @app-name))
  191.   (dest #dest)
  192. )
  193. (tooltype
  194.   (dest (tackon #dest @app-name))
  195.   (settooltype "Slave")
  196.   (settooltype "PreLoad")
  197. )
  198. (tooltype
  199.   (dest (tackon #dest @app-name))
  200.   (settooltype "PreLoad" "")
  201.   (settooltype "Slave" ("%s.Slave" @app-name))
  202.   (setdefaulttool "WHDLoad")
  203.   (setstack 10240)
  204.   (noposition)
  205. )
  206. (if
  207.   (exists #readme-file)
  208.   (copyfiles
  209.     (help @copyfiles-help)
  210.     (source #readme-file)
  211.     (dest #dest)
  212.   )
  213. )
  214. (if
  215.   (exists ("%s.info" #readme-file))
  216.   (
  217.     (copyfiles
  218.       (help @copyfiles-help)
  219.       (source ("%s.info" #readme-file))
  220.       (dest #dest)
  221.     )
  222.     (tooltype
  223.       (dest (tackon #dest #readme-file))
  224.       (noposition)
  225.     )
  226.   )
  227. )
  228. (if
  229.   (exists #save-file)
  230.   (copyfiles
  231.     (help @copyfiles-help)
  232.     (source #save-file)
  233.     (dest #dest)
  234.   )
  235. )
  236.  
  237. (P_MakeImages)
  238.  
  239. ;----------------------------
  240.  
  241. (exit)
  242.  
  243.